﻿@model Fish.Models.Users

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>
@using (Html.BeginForm("UpdateImage", "Users", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()
    @Html.HiddenFor(model => model.ID)
    <div class="form-group">
            @Html.LabelFor(model => model.UserImage, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                <img src='@Url.Action("ViewImage", "Users", new { id = Model.ID })' height="100" width="100" />
                <input type="file" name="uploadedImage" />
            </div>
        </div>
    <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" class="btn btn-default" value="Change" />
                <p style="color:red;font-size:12px;">*You must press Change to change the image!</p>
            </div>
        </div>
}
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <div class="form-horizontal">
        @Html.ValidationSummary(true)
        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(model => model.Password)

        <div class="form-group">
            @Html.LabelFor(model => model.Username, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Username)
                @Html.ValidationMessageFor(model => model.Username)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.DateOfBirth, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.DateOfBirth)
                @Html.ValidationMessageFor(model => model.DateOfBirth)                
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Email, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Email)
                @Html.ValidationMessageFor(model => model.Email)
            </div>
        </div>

        @Html.ActionLink("Change Password", "ChangePassword", "Users")

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Save" class="btn btn-default" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("Back to Profile", "Details","Users")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

